import rootApi from '@/api/root/root'
import messageBox from 'element-ui/packages/message-box'
const state = {
  total: '',
  list: []
}
const mutations = {
  GETTOTAL(state, number) {
    state.total = number
  },
  GETROOTLIST(state, list) {
    state.list = list
  }
}
const actions = {
  async getInfo({ commit }, { page, limit }) {
    try {
      const result = await rootApi.getRootInfo(page, limit)
      commit('GETTOTAL', result.data.total)
      commit('GETROOTLIST', result.data.items)
    } catch (e) {
      console.log(e)
    }
  }
}
const getters = {

}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
